3.1.87 \(\int \frac {(a+b x) (A+B x)}{x^3} \, dx\) [87]

Optimal. Leaf size=27 \[ -\frac {a A}{2 x^2}-\frac {A b+a B}{x}+b B \log (x) \]

[Out]

-1/2*a*A/x^2+(-A*b-B*a)/x+b*B*ln(x)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.071, Rules used = {77} \begin {gather*} -\frac {a B+A b}{x}-\frac {a A}{2 x^2}+b B \log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((a + b*x)*(A + B*x))/x^3,x]

[Out]

-1/2*(a*A)/x^2 - (A*b + a*B)/x + b*B*Log[x]

Rule 77

Int[((d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_))*((e_) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*
x)*(d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, d, e, f, n}, x] && IGtQ[p, 0] && (NeQ[n, -1] || EqQ[p, 1]) && N
eQ[b*e + a*f, 0] && ( !IntegerQ[n] || LtQ[9*p + 5*n, 0] || GeQ[n + p + 1, 0] || (GeQ[n + p + 2, 0] && Rational
Q[a, b, d, e, f])) && (NeQ[n + p + 3, 0] || EqQ[p, 1])

Rubi steps

\begin {align*} \int \frac {(a+b x) (A+B x)}{x^3} \, dx &=\int \left (\frac {a A}{x^3}+\frac {A b+a B}{x^2}+\frac {b B}{x}\right ) \, dx\\ &=-\frac {a A}{2 x^2}-\frac {A b+a B}{x}+b B \log (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 28, normalized size = 1.04 \begin {gather*} -\frac {a A}{2 x^2}+\frac {-A b-a B}{x}+b B \log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((a + b*x)*(A + B*x))/x^3,x]

[Out]

-1/2*(a*A)/x^2 + (-(A*b) - a*B)/x + b*B*Log[x]

________________________________________________________________________________________

Maple [A]
time = 0.01, size = 26, normalized size = 0.96

method result size
default \(-\frac {A b +B a}{x}-\frac {a A}{2 x^{2}}+b B \ln \left (x \right )\) \(26\)
norman \(\frac {\left (-A b -B a \right ) x -\frac {A a}{2}}{x^{2}}+b B \ln \left (x \right )\) \(27\)
risch \(\frac {\left (-A b -B a \right ) x -\frac {A a}{2}}{x^{2}}+b B \ln \left (x \right )\) \(27\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a)*(B*x+A)/x^3,x,method=_RETURNVERBOSE)

[Out]

-(A*b+B*a)/x-1/2*a*A/x^2+b*B*ln(x)

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 25, normalized size = 0.93 \begin {gather*} B b \log \left (x\right ) - \frac {A a + 2 \, {\left (B a + A b\right )} x}{2 \, x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(B*x+A)/x^3,x, algorithm="maxima")

[Out]

B*b*log(x) - 1/2*(A*a + 2*(B*a + A*b)*x)/x^2

________________________________________________________________________________________

Fricas [A]
time = 0.96, size = 29, normalized size = 1.07 \begin {gather*} \frac {2 \, B b x^{2} \log \left (x\right ) - A a - 2 \, {\left (B a + A b\right )} x}{2 \, x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(B*x+A)/x^3,x, algorithm="fricas")

[Out]

1/2*(2*B*b*x^2*log(x) - A*a - 2*(B*a + A*b)*x)/x^2

________________________________________________________________________________________

Sympy [A]
time = 0.11, size = 27, normalized size = 1.00 \begin {gather*} B b \log {\left (x \right )} + \frac {- A a + x \left (- 2 A b - 2 B a\right )}{2 x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(B*x+A)/x**3,x)

[Out]

B*b*log(x) + (-A*a + x*(-2*A*b - 2*B*a))/(2*x**2)

________________________________________________________________________________________

Giac [A]
time = 1.73, size = 26, normalized size = 0.96 \begin {gather*} B b \log \left ({\left | x \right |}\right ) - \frac {A a + 2 \, {\left (B a + A b\right )} x}{2 \, x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(B*x+A)/x^3,x, algorithm="giac")

[Out]

B*b*log(abs(x)) - 1/2*(A*a + 2*(B*a + A*b)*x)/x^2

________________________________________________________________________________________

Mupad [B]
time = 0.04, size = 25, normalized size = 0.93 \begin {gather*} B\,b\,\ln \left (x\right )-\frac {\frac {A\,a}{2}+x\,\left (A\,b+B\,a\right )}{x^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*x)*(a + b*x))/x^3,x)

[Out]

B*b*log(x) - ((A*a)/2 + x*(A*b + B*a))/x^2

________________________________________________________________________________________